<?php
/**
 * Created by PhpStorm.
 * User: jimmyhsu
 * Date: 2016/10/24
 * Time: 13:58
 */
include ("checkvalid.php");

$id = $_POST['id'];
$type = $_POST['type'];
if ($type == 'dw') {
	$sql = "delete from dwtb where id=$id";
	mysql_query($sql)or die("db err");
} else if ($type == 'sh'){
	$sql = "delete from secondhandtb where id=$id";
	mysql_query($sql)or die("db err");
} else {
	die("wrong parameter: type ".$type); 
}
echo "success";